Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy resources into build directory for MacOS #205

Closed
wants to merge 3 commits into from
Closed

Copy resources into build directory for MacOS #205

wants to merge 3 commits into from

Conversation

kanya-approve
Copy link

@kanya-approve kanya-approve commented Aug 10, 2023

Copies contents of res directory into build directory for MacOS to resolve the follow messages on launch:

  • "css failed parsing (Failed to import: Error opening file /Users/REDACTED/Documents/abaddon/build/css/main.css: No such file or directory)"
  • "css failed to load (: 1:0Failed to import: Error opening file /Users/REDACTED/Documents/abaddon/build/css/main.css: No such file or directory)"
  • "The emoji file couldn't be loaded!"
Screenshot 2023-08-09 at 21 57 51 Screenshot 2023-08-09 at 21 57 39

Copies contents of res directory into build directory for MacOS to resolve the follow messages on launch:
- "css failed parsing (Failed to import: Error opening file /Users/REDACTED/Documents/abaddon/build/css/main.css: No such file or directory)"
- "css failed to load (<broken file>: 1:0Failed to import: Error opening file / Users/REDACTED/Documents/abaddon/build/css/main.css: No such file or directory)"
- "The emoji file couldn't be loaded!"
@kanya-approve kanya-approve changed the title Update CMakeLists.txt Copy resources into build directory for MacOS Aug 10, 2023
@ouwou
Copy link
Member

ouwou commented Aug 10, 2023

i think the right way to do this would be install, no? admittedly i should have had this sorted out a while ago 😅

@kanya-approve
Copy link
Author

i think the right way to do this would be install, no? admittedly i should have had this sorted out a while ago 😅

Switched it now

@kanya-approve
Copy link
Author

Is there anything else that I need to change @ouwou ?

@ouwou
Copy link
Member

ouwou commented Aug 20, 2023

did some research of my own and i think what we want is to do this:

add_custom_command(TARGET abaddon POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy_directory
        ${CMAKE_SOURCE_DIR}/res/ $<TARGET_FILE_DIR:abaddon>)

using file feels icky to me and also appears to only copy files during the configuration step, so if something in res/ changes without a change to the build configuration it wont update. the above should re-copy for every successful build
i do want to support install targets but that requires a decent amount of extra work to do properly and is kind of out of scope here.

let me know if that works how youd like it to since it looks like the best option. also we dont need to do if (APPLE) in this case.

@kanya-approve
Copy link
Author

Not needed if #207 gets done

@ouwou
Copy link
Member

ouwou commented Aug 25, 2023

Not needed if #207 gets done

merged #207 so ill close then. might still do some more research of my own for copying stuff around in the future though

@ouwou ouwou closed this Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants